<?php
/*
*	公共头部导航

*/
?>
<script type='text/javascript' src='/wp-content/themes/pai2016/js/menu.js'></script>
<link rel='stylesheet' id='css-css'  href='/wp-content/themes/pai2016/css/css_zt.css' type='text/css' media='all' />

<div class="menuTop">
    <div class="showMenu showMenuBtn po_a translateY">
      <a href="javascript:void(0)" ></a>
    </div>
    <h1 class="logo po_a translateXY"><img src="<?php the_field('logo_img','options');?>" /></h1>
    <a href="tel:<?php the_field('tel','options');?>" class="topTell po_a translateY">
      <img src="<?php echo get_template_directory_uri();?>/images/icon_03.png" />
    </a>
  </div>
<!--下拉菜单-->
<div class="popMenus">
  <div class="pop_title cf po_a"><span>导航信息</span><a href="javascript:void(0)" class="closePopMenu translateY po_a float_r"><img src="<?php echo get_template_directory_uri();?>/images/closePopMenu.png" width="100%"/></a> </div>
  <div class="menuContainer" id="menuContainer">
    <div class="menuNavs">
      <ul>      	
        <!--<li><a href="javascript:void(0)">关于鹏爱</a></li>-->
		<li><a href="javascript:void(0)">脂肪精雕</a></li>
	
      	<?php
      		$projects_top = get_terms('items',array('hide_empty'=> false,'orderby'=>'id','order'=>'ASC','parent'=>0));
      		$categories = get_categories();
      		foreach ($projects_top as $key => $value) {
				if($value->name=="脂肪精雕"){
					continue;
				}
      	?>
        <li><a href="javascript:void(0)"><?php echo $value->name;?></a></li>
        <?php
        	}
        ?>
        <li><a href="/contact/">来院路线</a></li>
      </ul>
    </div>
    <div class="menuContents po_r">
	    <div class="menuContentBox ">
		<?php /*
			<div class="menuContent " >
				<div class="menuLists">
					<div class="menuList">
						<h4>关于鹏爱</h4>
						<div class="links cf">
							<?php
								$sider_menu = wp_nav_menu(    //调用导航
									array( 
										'container' => false,
										'items_wrap' => '%3$s',
										'theme_location' => 'sider-menu', 
										'menu_class' => 'nav', 
										'echo' => false,
										'walker' => new description_walker() //注意前面要有 new
									)
								);
								echo preg_replace("/<(\/li.*?)>/si","",preg_replace("/<(li.*?)>/si","",$sider_menu));
							?>
							
						</div>
					</div>
				</div>
			</div>
			*/?>
			<div class="menuContent " >
				<div class="menuLists">
					<?php
						$projects = get_terms('items',array('hide_empty'=> false,'orderby'=>'id','order'=>'ASC','parent'=>112));
						foreach ($projects as $key => $value) {
					?>
					<div class="menuList">
						<h4><?php echo $value->name;?></h4>
						<div class="links cf">
							<?php
								$args=array(
									'post_type' => 'projects',
									'tax_query' => array(
										array(
										'taxonomy' => 'items',
										'field' => 'slug',
										'terms' => array($value->slug)
										  )
									),
									'meta_key' => 'rank',
									'orderby'  => array('meta_value_num' => 'DESC', 'date' => 'DESC'),
									'posts_per_page' =>20
								);
								$query = new WP_Query($args);
								while($query->have_posts()):$query->the_post();
							?>
							<?php /*<a href="<?php echo get_permalink(get_field('special'));?>"><?php the_title();?></a>*/?>
							<a href="javascript:void(0);" onclick="openZoosUrl();"><?php the_title();?></a>
							<?php
								endwhile;
								wp_reset_query();
							?>
						</div>
					</div>
					<?php
						}
					?>
				</div>
			</div>
			
	    	<?php
	    		foreach ($projects_top as $key => $value) {
					if($value->name=="脂肪精雕"){
						continue;
					}
	    	?>
			<div class="menuContent " >
				<div class="menuLists">
					<?php
						$projects = get_terms('items',array('hide_empty'=> false,'orderby'=>'id','order'=>'ASC','parent'=>$value->term_id));
						foreach ($projects as $key => $value) {
					?>
					<div class="menuList">
						<h4><?php echo $value->name;?></h4>
						<div class="links cf">
							<?php
								$args=array(
									'post_type' => 'projects',
									'tax_query' => array(
										array(
										'taxonomy' => 'items',
										'field' => 'slug',
										'terms' => array($value->slug)
										  )
									),
									'meta_key' => 'rank',
									'orderby'  => array('meta_value_num' => 'DESC', 'date' => 'DESC'),
									'posts_per_page' =>20
								);
								$query = new WP_Query($args);
								while($query->have_posts()):$query->the_post();
							?>
							<?php /*<a href="<?php echo get_permalink(get_field('special'));?>"><?php the_title();?></a>*/?>
							<a href="javascript:void(0);" onclick="openZoosUrl();"><?php the_title();?></a>
							<?php
								endwhile;
								wp_reset_query();
							?>
						</div>
					</div>
					
					<?php
						}
					?>
				</div>
			</div>
			<?php
				}
			?>
			<div class="menuContent ">
				<div class="menuLists">
					<div class="menuList">
						<h4>新闻资讯</h4>
						<div class="links cf">
							<?php
								foreach ($categories as $key => $value) {
							?>
							<?php /*<a href="<?php echo get_permalink(get_field('special'));?>"><?php the_title();?></a>*/?>
							<a href="javascript:void(0);" onclick="openZoosUrl();"><?php the_title();?></a>
							<?php
								}
							?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
</div>
<!--下拉菜单结束-->

<!-- 专题顶部活动 -->
<?php
    if(is_single()){
        if(get_post_type($post->ID)=='special'){
        	get_sidebar('special_ad');
        }
    }
?>